<#import "/global.ftl" as user_role_edit />
<form id="userRoleEditForm" method="post">
    <table>
        <tr>
            <td><label for="roleId">roleId:</label></td>
            <td>
                <input class="easyui-combobox" type="text" id="roleId" name="sysUserRole.roleId"
                   data-options="required:true,valueField:'roleId',textField:'roleName',url:'<@user_role_edit.basePath/>/sys/role/menu/roles',value:'${sysUserRole.roleId}'"/>
            </td>
        </tr>
        <tr>
            <td><label for="accountId">accountId:</label></td>
            <td>
                <select id="accountId" class="easyui-combobox" name="sysUserRole.accountId" style="width:200px;"
                        data-options="valueField:'accountId',textField:'userName',url:'<@user_role_edit.basePath/>/sys/user/users',required:true,value:'${sysUserRole.accountId}'">
                </select>
            </td>
        </tr>
    </table>
    <input type="hidden" name="pageType" value="${pageType}" />
    <input type="hidden" name="sysUserRole.roleMenuId" value="${sysUserRole.userRoleId}" />
</form>
<script type="text/javascript">
    function userRoleEditSubmit(){
        $.post('<@user_role_edit.basePath/>/sys/user/role/save',
            $("#userRoleEditForm").serialize(),
            function(data){
                if(true==data.success){
                    $("#userRoleTables").datagrid('reload');
                    $('#addUserRoleDiv').dialog('close');
                } else {
                    $.messager.alert('error',data.message);
                }
            });
    }

</script>

